<template>
  <div>
    <v-top></v-top>
    <div>
      手机号：
      <input type="text" v-model="user.phone" />
    </div>
    <div>
      昵称：
      <input type="text" v-model="user.nickname" />
    </div>

    <div>
      密码：
      <input type="text" v-model="user.password" />
    </div>
    <div>
      <button @click="register">注册</button>
    </div>
  </div>
</template>

<script>
// import axios from "axios";
import {reqRegister} from "../../http/api"
export default {
  data() {
    return {
      data: [],
      user: {
        phone: "",
        nickname: "",
        password: "",
      },
    };
  },
  methods: {
    register() {
      reqRegister(this.user).then((res) => {
      
        if(res.data.code==200){ 
           console.log(res);
            this.$router.push("/login")
        }
      });
    },
  },
};
</script>

<style>
</style>